In video coding, inter-frame motion compensation prediction is of great importance for improving compressive performance. The technology of inter-frame motion compensation prediction is mainly to search for the motion vector information that most precisely matches the current coding block in reference frame and the motion vector information of the current coding block occupies a significant amount of bits in the code stream of an inter coding frame. The motion vector information is usually generated and encoded into the code stream at an encoder, and then a decoder performs motion compensation prediction on the current decoding block according to the decoded motion vector information. Inter-frame prediction technology based on motion compensation is employed in current principal video coding standards, such as Advanced Video Coding (H.264/AVC) Audio Video Coding Standard (AVS), and Scalable Video Coding (H.264 SVC).
In H.264/AVC, inter-frame prediction is to obtain the predictor for the current coding block by combining the motion vector information decoded from the code stream with the information of the corresponding region of decoded frame. The motion vector information is obtained at the encoder by using a nonstandard motion estimation algorithm. In H.264/AVC, a bidirectional coding makes uses of composite hypothesis predictions to obtain the average value of two motion compensation predictors as the final prediction value.
H.264/AVC explicitly requires that the motion vector information must be written into the code stream, and even in the case that signal characteristics allow the decoder to deduce motion vector parameters, it is required that the motion vector information must be encoded in the code stream at the encoder, thus increasing bits of code stream.
A conventional method proposes an inter coding method based on H.264/AVC template matching. The method introduces new types of Macroblock and sub-Macroblock to identify whether template matching prediction should be used. This method improves the coding efficiency by averaging a plurality of prediction reference signals, in which the number of the prediction reference signals used is determined with a threshold obtained by calculating template matching cost distortion.
When multi-hypothesis prediction is used, the preceding method obtains the final prediction value by averaging hypothesis prediction values derived from one reference frame, so that both the prediction performance and the coding efficiency are relatively low. Moreover, the averaging method as used is to calculate the arithmetic average value of the hypothesis prediction values. Because calculation of the arithmetic average value is a floating point computation, the great amount of decimal computation renders implementation of software and hardware complicated.